package com.mio.hdfs.sort;

import java.io.IOException;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Reducer;

public class SortReduce extends Reducer<SortBean, NullWritable, SortBean, NullWritable> {

	int index = 1;

	@Override
	protected void reduce(SortBean bean, Iterable<NullWritable> values, Context context)
			throws IOException, InterruptedException {
//		int index = 1;
		for (NullWritable value : values) {
			bean.setIndex(index);
			index++;
			context.write(bean, NullWritable.get());

		}
	}

}
